package com.zzl.scala

import org.apache.spark.{SparkConf, SparkContext}

object Test2 {
  def main(args: Array[String]): Unit = {
    val sp = new SparkConf();
    sp.setAppName("zhangzeli")
    sp.setMaster("local")
    val sc = new SparkContext(sp);
    val rdd =sc.parallelize(Array("hello","world","hello","wangke"),2)
    val pairs = rdd.map(s=>(s,1));
    val count= pairs.reduceByKey(_+_)
    count.count()
    while (true){}
  }

}
